<?php
namespace app\zhihui\controller;

use app\common\model\ZhBanner as ZhBannerModel;
use app\home\controller\Base;

/**
 * 轮播图控制器
 * Class Zhbanner
 * @package app\index\controller
 */
class Zhbanner extends Base
{
    /**
     * [index  列表]
     * @return json
     * @author [C。]
     */
    public function index()
    {
        $param = input('param.');
        $model = new ZhBannerModel;
        $this->getPageAndSize($param);
        $map = [];
        try {
            $map['states'] = 1;
            $map['comid'] = $param['comid'];
            $map['type'] = $param['type'];
            $lists = $model->getlist($map, 0, 3, 'id,img');
        } catch (\Exception $e) {
            systembug($e->getMessage(),2,$this->url);
            return admin_json(-1, $e->getMessage());
        }
        return admin_json(1, '获取成功', $lists);
    }
}